package com.shiguiwu.springmybatis.javabase.thread.lock.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;

/**
 * @description: 锁模型
 * @author: stone
 * @date: Created by 2021/9/10 11:13
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.lock.model
 */
@Data
@TableName("t_lock")
public class LockModel {

    /**
     * 锁的唯一值
     */
    @TableId
    private String lockKey;

    /**
     * 请求id,同一个线程里请求id一样
     */
    private String requestId;

    //锁次数
    private Integer lockCount;

    //锁超时
    private Long timeout;

    //乐观锁版本
    @Version
    private Integer version;
}
